<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<div class="project_contents">
	<h1>Document</h1>
	<div class="project_in">
		<input type="button" value="글쓰기" onclick="writeDocument()" id="writeDoc" class="btn">
		<div id="write_wraper_document">
			<form method="post">
				<input type="text" name="title" id="title" class="document_title" placeholder="제목을 입력하세요." value=""><br/>
				<textarea name="article" id="board_content" class="document_content"> </textarea><br/>
				<input type="button" class="btn" onclick="document_submit()" value="Submit"/>
			</form>
		</div>
		
		<hr>
		<c:forEach items="${docList }" var="doc">
			<a id="documentList-title" onclick="document_pick(${doc.docNo})">
			${doc.docTitle }</a>
			<p id="documentList-date">
			<fmt:formatDate	value="${doc.docWriteDate }" type="both" />
			</p> 
			<br>
			<div class="over-text2">
			${doc.docContents}
			</div>
			<hr>
		</c:forEach>
		
		
		<script type="text/javascript">
			var oEditors = [];
			function writeDocument(){
				$("div.project_in input#writeDoc").css({'display':'none'});
				$("div#write_wraper_document").css({'display' : 'block'});
				nhn.husky.EZCreator.createInIFrame({
					oAppRef : oEditors,
					elPlaceHolder : "board_content",
					sSkinURI : "resources/editor/SEditorSkin.html",
					fCreator : "createSEditorInIFrame"
				});
			}
			
			
		</script>
	</div>
</div>